local ServerOHOH = _G.ServerOHOH;
local M = ServerOHOH.class.new(script, ServerOHOH.files.Server_PlayerComponent(),script.Parent.Name);
local ItemTool=_G.CommonOHOH.load.ItemTool();

function M.new(self,...)
	return M(self,...);
end;

function M.ctor(self, parent)
	M.super.ctor(self, parent);
	self.player=self.parent
	self.DataBase=self.parent:GetComponent(ServerOHOH.load.Server_PlayerDataComponent())
	self.data=self.DataBase:GetData("set_data")
    
end;


function M.Set(self,key,v)
	if not self.data[key] then
		return false
	end
	
	self.DataBase:Execut(function()
		if self.data[key]==0 then
			self.data[key]=1
		else
			self.data[key]=0
		end
	end);

	return true
end

local redeem_cfg =require(game.ServerScriptService.Config.redeem);

function M.RollHide(self,num,isFirst)
	local skindata = self.data.rollHide
	if skindata then
		self.DataBase:Execut(function()
			self.data.rollHide = num
		end);
	
		return true
	end

	return false
end


function M.dtor(self)
	M.super.dtor(self);
end;

local function_list = _G.ServerOHOH.function_list

M:RegistFunction(function_list.set_change,M.Set)
M:RegistFunction(function_list.roll_hide,M.RollHide)

return M